import java.io.*;
import java.util.*;
import java.util.Scanner;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;

public class Contact extends JPanel
{
	private String f_name, l_name, company, department, position, mobile, phone, fax, email, address, homepage;

	private JPanel columnP;
	private JLabel nameL, mobileL, emailL;
	public JRadioButton contactRB;
	public int order = -1;

	public Contact (String f_name, String l_name, String company, String department, String position, String mobile, String phone, String fax, String email, String address, String homepage)
	{
		this.f_name = f_name;
		this.l_name = l_name;
		this.company = company;
		this.department = department;
		this.position = position;
		this.mobile = mobile;
		this.phone = phone;
		this.fax = fax;
		this.email = email;
		this.address = address;
		this.homepage = homepage;

		contactRB = new JRadioButton ();
			contactRB.setBackground (Color.white);


		setBackground (Color.white);
			setPreferredSize (new Dimension (692, 26));
		setLayout (new BoxLayout (this, BoxLayout.X_AXIS));

		columnP = new JPanel ();
			columnP.setBackground (Color.white);
			columnP.setLayout (new GridLayout (1,3));
		
		nameL = new JLabel (" " + this.f_name + " " + this.l_name);
		mobileL = new JLabel (" " + this.mobile);
		emailL = new JLabel (" " + this.email);


		columnP.add (nameL);
		columnP.add (mobileL);
		columnP.add (emailL);

		if (mobile.equals("NULL"))	 mobileL.setVisible (false);
		else	mobileL.setVisible (true);
		if (email.equals("NULL"))		emailL.setVisible (false);
		else	emailL.setVisible (true);



		add (Box.createRigidArea (new Dimension (4,0)));
		add (contactRB);
		add (Box.createRigidArea (new Dimension (10,0)));
		add (columnP);
		add (Box.createRigidArea (new Dimension (4,0)));
	}



	public void changeContact (String f_name, String l_name, String company, String department, String position, String mobile, String phone, String fax, String email, String address, String homepage)
	{
		this.f_name = f_name;
		this.l_name = l_name;
		this.company = company;
		this.department = department;
		this.position = position;
		this.mobile = mobile;
		this.phone = phone;
		this.fax = fax;
		this.email = email;
		this.address = address;
		this.homepage = homepage;

		nameL = new JLabel (" " + this.f_name + " " + this.l_name);
		mobileL = new JLabel (" " + this.mobile);
		emailL = new JLabel (" " + this.email);

		if (mobile.equals("NULL"))	 mobileL.setVisible (false);
		else	mobileL.setVisible (true);
		if (email.equals("NULL"))		emailL.setVisible (false);
		else	emailL.setVisible (true);
	}


	public String getFName ()			{ return (f_name); }
	public String getLName ()			{ return (l_name); }
	public String getCompany ()		{ return (company); }
	public String getDepartment ()	{ return (department); }
	public String getPosition ()			{ return (position); }
	public String getMobile ()			{ return (mobile);	}
	public String getPhone ()			{ return (phone);	}
	public String getFax ()				{ return (fax); }
	public String getEmail ()				{ return (email); }
	public String getAddress ()			{ return (address); }
	public String getHomepage ()		{ return (homepage); }
}
